libostree: Add missing checks for invalid timestamps
authorPhilip Withnall <withnall@endlessm.com>
Tue, 2 May 2017 21:33:04 +0000 (22:33 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 3 May 2017 15:23:15 +0000 (15:23 +0000)
commit4c731165bb945bff834ed6a4129c5305d841073a
treecf3779f81e37edf5cdb9a1a6a3b2a16060df99f9
parenta1c866ed52134bac2aff79cd95e7558edd788032
libostree: Add missing checks for invalid timestamps

g_date_time_new_from_unix_utc() will not always return a valid GDateTime
— if the input timestamp is too big, GDateTime cannot represent it, and
the constructor returns NULL.

Add some missing checks for these situations. We don’t ever expect
timestamps to be this big, but they could be as a result of corruption
or a malicious repository.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #825
Approved by: cgwalters
src/libostree/ostree-gpg-verify-result.c
src/libostree/ostree-sysroot-upgrader.c
src/ostree/ot-remote-cookie-util.c